use std::error::Error;

pub type FseResult<T> = Result<T,FseError>;

#[derive(Debug)]
pub enum FseError {
    Byte(crate::byte::ByteError),
}

impl std::fmt::Display for FseError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Self::Byte(e) => write!(f,"[lit]{e}")
        }
    }
}

impl Error for FseError { }

impl From<crate::byte::ByteError> for FseError {
    fn from(value: crate::byte::ByteError) -> Self {
        Self::Byte(value)
    }
}